Mini-OS: netfront: Fix rx ring starvation in network_rx
authorMartin Lucina <martin@lucina.net>
Thu, 4 Dec 2014 13:33:53 +0000 (14:33 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Tue, 13 Jan 2015 10:40:28 +0000 (10:40 +0000)
commiteed8d774ce19dcae26e1cc077088397681ad65eb
tree8fd061e2f73c14e3ca5b7391eb10db77273ad99f
parent762c08496e9732822f172801d5576cd24fff784a
Mini-OS: netfront: Fix rx ring starvation in network_rx

In network_rx() we must push the same amount of requests back onto the
ring in the second loop that we consumed in the first loop. Otherwise
the ring will eventually starve itself of free request slots and no
packets will be delivered.

Further, we make the HAVE_LIBC codepath clearer to follow by removing
the "some" variable from the for loop initialisation and conditions.

Signed-off-by: Martin Lucina <martin@lucina.net>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
extras/mini-os/netfront.c